diff options
Diffstat (limited to 'pages/anime/[...id].js')
| -rw-r--r-- | pages/anime/[...id].js | 43 |
1 files changed, 23 insertions, 20 deletions
diff --git a/pages/anime/[...id].js b/pages/anime/[...id].js index a2c84a4..c273d65 100644 --- a/pages/anime/[...id].js +++ b/pages/anime/[...id].js @@ -207,7 +207,9 @@ export default function Info({ info, color }) { setLoading(false); try { const [res] = await Promise.all([ - fetch(`https://api.moopa.my.id/meta/anilist/info/${id?.[0]}`), + fetch( + `https://api.moopa.my.id/meta/anilist/info/${id?.[0]}?provider=zoro` + ), // fetch("https://graphql.anilist.co/", { // method: "POST", // headers: { @@ -242,29 +244,30 @@ export default function Info({ info, color }) { ); const datas = await res.json(); - if (datas) { - const release = datas.results.map((i) => i.releaseDate); - const match = closestMatch(info.startDate.year, release); - const filter = datas.results.find((i) => i.releaseDate === match); - - // const found = filter.find((i) => i.title === info.title.romaji); - - // setLog(found); - - if (filter) { - const res = await fetch( - `https://api.moopa.my.id/anime/gogoanime/info/${filter.id}` - ); - const dataA = await res.json(); - setEpisode(dataA.episodes); - // setLog(dataA); - } - } else if (res.status === 500) { + // if (datas) { + // const release = datas.results.map((i) => i.releaseDate); + // const match = closestMatch(info.startDate.year, release); + // const filter = datas.results.find((i) => i.releaseDate === match); + + // // const found = filter.find((i) => i.title === info.title.romaji); + + // // setLog(found); + + // if (filter) { + // const res = await fetch( + // `https://api.moopa.my.id/anime/gogoanime/info/${filter.id}` + // ); + // const dataA = await res.json(); + // setEpisode(dataA.episodes); + // // setLog(dataA); + // } + // } + if (res.status === 500) { setEpisode(null); setEpiStatus("error"); setError(datas.message); } else { - setEpisode(datas.episodes); + setEpisode([]); } // setColor({ // backgroundColor: `${data?.color || "#ffff"}`, |